package com.compayname.projectname.controller;

import com.compayname.projectname.base.data.Response;
import com.compayname.projectname.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value = "/sys")
public class OutputController {

    @Autowired
    public UserService service;


    @GetMapping(value="/index0")
    public Response<Map<String, Object>> get(){
        Response<Map<String, Object>> response = new Response<>();
        Map<String, Object> user = new HashMap<>();
        user.put("name", "demo");
        user.put("age", 25);
        response.setData(user);
        return  response;
    }

//    @GetMapping(value = "/hello")
    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public String hello(Model model) {
        String name = "Mr.Liu";
        model.addAttribute("name", name);
        return "hello";
    }

}